import bibtexparser

with open('ref.bib') as bibtex_file:
    bib_database1 = bibtexparser.load(bibtex_file)
with open('bibtex1.bib') as bibtex_file:
    bib_database2 = bibtexparser.load(bibtex_file)
lack = {}
for e in bib_database1.entries:
    flag = False
    for e1 in bib_database2.entries:
        if(e.get('ID') == e1.get('ID')):
            flag = True
            break
    if flag is False:
        lack[e.get('ID')] = e
print(lack)
print(len(lack))
